<div ng-controller="receivableReconciliationController">
    <div class="bg-light lter b-b wrapper-sm">
        <h1 class="m-n font-thin h4">{{title}}</h1>
    </div>
    <div class="wrapper-sm">
        <div class="panel panel-default">
            <div class="panel-body">
                <form name="step1" id="reconform" class="form-validation form-horizontal" novalidate>
                    <button ng-show="false"></button>
                    <div class="form-group">
                        <div class="panel-heading font-bold m-t-n m-b-sm">
                            基本信息
                        </div>
                        <label class="col-lg-1 pull-left control-label">订单编号  :</label>
                        <label class="col-lg-2 control-label text-left">{{orderData.orderId}}</label>

                        <label class="col-lg-1 pull-left control-label">子询价编号  :</label>
                        <label class="col-lg-2 control-label text-left">{{orderData.inquiryChildId}}</label>

                        <label class="col-lg-1 pull-left control-label">客户订单编号  :</label>
                        <label class="col-lg-2 control-label text-left">{{orderData.clientOrderId}}</label>

                        <label class="col-lg-1 pull-left control-label">下单时间  :</label>
                        <label class="col-lg-2 control-label text-left">{{orderData.creationTime}}</label>         
                    </div>
                    <div class="form-group">
                        <label class="col-lg-1 pull-left control-label">紧急程度</label>
                        <label class="col-lg-2 control-label text-left">{{orderData.responseTime}}</label>

                        <label class="col-lg-1 pull-left control-label">计划专员  :</label>
                        <label class="col-lg-2 control-label text-left">{{orderData.plannerName}}</label>
                        <label class="col-lg-1 pull-left control-label">商务专员</label>
                        <div class="col-lg-2">
                            <label class="control-label pull-left">{{orderData.businessAffairsName}}</label>
                        </div>
                        <label class="col-lg-1 pull-left control-label">客服专员</label>
                        <div class="pull-left m-l-sm m-r-sm">
                            <label class="control-label pull-left">{{orderData.customerServiceName}}</label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-1 pull-left control-label">调度专员</label>
                        <div class="col-lg-2">
                            <label class="control-label pull-left">{{orderData.dispatcherName}}</label>
                        </div>
                        
                        <label class="col-lg-1 pull-left control-label">客户单位</label>
                        <label class="col-lg-2 control-label text-left">{{orderData.clientName}}</label>
                        <label class="col-lg-1 pull-left control-label">发货计划人</label>
                        <label class="col-lg-2 control-label text-left">{{orderData.consignorName}}</label>
                        <div>
                            <label class="col-lg-1 pull-left control-label">发货人号码</label>
                            <label class="col-lg-2 control-label text-left">{{orderData.consignorPhone}}</label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-1 pull-left control-label">发货内容  :</label>
                        <label class="col-lg-10 control-label text-left">{{orderData.content}}</label>
                    </div>
                    <div class="form-group">
                        <div class="panel-heading font-bold m-b-sm">
                            线路货物应收信息<span class="text-danger">*</span>
                        </div>
                        <div class="wrapper font-bold m-t-n">
                            线路信息
                        </div>
                        <label class="col-lg-1 pull-left control-label">发货地址</label>
                        <div class="col-lg-10 form-inline">
                            <div class="form-group form-inline m-n">
                                <div class="form-group m-n">
                                    <input id="receivableClose_reconciliation_shipProvinceCode" name="shipProvinceCode" type="text" class="form-control" ng-value="shipProvinceCode" disabled="disabled">
                                </div>
                                <div class="form-group m-n">
                                    <input id="receivableClose_reconciliation_shipCity" name="shipCity" type="text" class="form-control" ng-value="shipCity" disabled="disabled">
                                </div>
                                <div class="form-group m-n">
                                    <input id="receivableClose_reconciliation_shipArea" name="shipArea" type="text" class="form-control" ng-value="shipArea" disabled="disabled">
                                </div>
                                <div class="form-group m-n">
                                    <input id="receivableClose_reconciliation_shipdetail" type="text" class="form-control" style="width:146%" ng-value="shipdetail" placeholder="请填写详细地址" disabled="disabled" name="shipdetail">
                                </div>
                            </div>
                        </div>
                        <div class="line pull-in"></div>
                        <label class="col-lg-1 pull-left control-label">送货地址</label>
                        <div class="col-lg-10 form-inline">
                            <div class="form-group form-inline m-n">
                                <div class="form-group m-n">
                                    <input id="receivableClose_reconciliation_deliverProvince" name="deliverProvince" type="text" class="form-control" ng-value="deliverProvince" disabled="disabled">
                                </div>
                                <div class="form-group m-n">
                                    <input id="receivableClose_reconciliation_deliverCity" name="deliverCity" type="text" class="form-control" ng-value="deliverCity" disabled="disabled">
                                </div>
                                <div class="form-group m-n">
                                    <input id="receivableClose_reconciliation_deliverArea" name="deliverArea" type="text" class="form-control" ng-value="deliverArea" disabled="disabled">
                                </div>
                                <div class="form-group m-n">
                                    <input id="receivableClose_reconciliation_deliverdetail" type="text" class="form-control" style="width:146%" ng-value="deliverdetail" placeholder="请填写详细地址" disabled="disabled" name="deliverdetail">
                                </div>
                            </div>
                        </div>
                        <div class="line pull-in"></div>
                        <label class="col-lg-1 pull-left control-label">中转地</label>
                        <div class="col-lg-6">
                            <span class="ui-select-bootstrap dropdown form-control" disabled="disabled">
                                <span ng-repeat="item in orderData.viaAddressList">
                                    <span style="margin-right: 3px; margin-bottom:3px;" class="ui-select-match-item btn btn-default btn-xs">
                                        <span>{{item}}</span>
                            </span>
                            </span>
                            </span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-1 pull-left control-label">发货时间</label>
                        <div class="col-lg-2">
                            <div class="input-group input-group-sm date">
                                <input id="shipStartTime" name="ship-start-time" datetimepicker plugintype="datetime" ng-value="shipTime" placeholder="发货时间" class="form-control" type="text" disabled="disabled" />
                                <span id="openshipStartTime" class="input-group-addon curpoint">
                                    <span class="glyphicon glyphicon-calendar"></span>
                                </span>
                            </div>
                        </div>
                        <label class="pull-left control-label">到货时间</label>
                        <div class="col-lg-2">
                            <div class="input-group input-group-sm date">
                                <input id="shipEndTime" name="ship-end-time" datetimepicker plugintype="datetime" ng-value="arriveTime" placeholder="到货时间" class="form-control" type="text" disabled="disabled" />
                                <span id="openshipEndTime" class="input-group-addon curpoint">
                                    <span class="glyphicon glyphicon-calendar"></span>
                                </span>
                            </div>
                        </div>
                        <label class="pull-left control-label">里程数</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_mileage" type="text" class="form-control input-sm" ng-value="mileage" placeholder="请填写里程数" disabled="disabled" name="mileage">
                        </div>
                        <label class="pull-left control-label">公里</label>
                    </div>
                    <div class="form-group">
                        <div class="wrapper font-bold m-t-n">
                            货物信息
                        </div>
                        <label class="col-lg-1 pull-left control-label">货物类别</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_goodsTypeName" type="text" class="form-control input-sm" ng-model="receivableData.goodsTypeName" placeholder="请填写货物类别" disabled="disabled" name="goodsTypeName">
                        </div>
                        <label class="pull-left control-label">货物名称</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_goodsName" type="text" class="form-control input-sm" ng-model="receivableData.goodsName" placeholder="请填写货物名称" disabled="disabled" name="goodsName">
                        </div>
                        <label class="pull-left control-label">吨位范围</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_tonnageRange" type="text" class="form-control input-sm" ng-model="receivableData.tonnageRange" disabled="disabled" name="tonnageRange">
                        </div>
                        <div class="line pull-in"></div>
                        <label class="col-lg-1 pull-left control-label">货物数量<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_goodsNum" type="text" ng-pattern="/^[0-9]+(.[0-9]{1,4})?$/" class="form-control input-sm isDecimal" ng-model="goodsNum" placeholder="请填写货物数量" ng-disabled="priceDis" name="goodsNum" required>
                        </div>
                        <div class="pull-left m-l-n-sm">
                            <select id="receivableClose_reconciliation_goodsNumUnit" class="form-control input-sm" ng-model="goodsNumUnit" name="goodsNumUnit" ng-disabled="priceDis" ng-options="x.value as x.text for x in goodsNumUnitDropDown" required>
                                <option value="">请选择</option>
                            </select>
                        </div>
                        <label class="pull-left m-l control-label">货物数量2</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_goodsNumTwo" type="text" ng-pattern="/^[0-9]+(.[0-9]{1,4})?$/" class="form-control input-sm isDecimal" disabled="disabled" ng-model="receivableData.quantityOfGoodsTwoStr" placeholder="请填写货物数量2" name="goodsNumTwo">
                        </div>
                        <div class="pull-left m-l-n-sm">
                            <input id="receivableClose_reconciliation_goodsNumUnitTwo" type="text" class="form-control input-sm" id="goodsNumUnitTwo" ng-model="receivableData.goodsUnitTwo" disabled="disabled" name="goodsNumUnitTwo">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="wrapper font-bold m-t-n">
                            应收价格信息
                        </div>
                        <label class="col-lg-1 pull-left control-label">应收费用类型</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_feeType" type="text" class="form-control input-sm" disabled="disabled" ng-model="receivableData.feeType" placeholder="" name="feeType">
                        </div>
                        <label class="w-xxss m-l pull-left control-label">应收单价</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_receivablePrice" type="text" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/" class="form-control input-sm" ng-disabled="priceDis" ng-model="receivablePrice" placeholder="请填写应收单价" required name="receivablePrice">
                        </div>
                        <div class="pull-left m-l-n-sm">
                            <select id="receivableClose_reconciliation_receivablePriceUnit" class="form-control input-sm" ng-disabled="priceDis" ng-model="receivablePriceUnit" name="receivablePriceUnit" ng-options="x.value as x.text for x in receivablePriceUnitDropDown">
                                <option value="">请选择</option>
                            </select>
                        </div>
                        <label class="pull-left m-l control-label">应收总价<span ng-if="title === '应收对账'" class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_receivableTotal" type="text" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/" ng-disabled="priceDis" class="form-control input-sm" ng-model="receivableTotal" placeholder="请填写应收总价" name="receivableTotal">
                        </div>
                        <label class="pull-left m-l-n-sm control-label">元</label>
                        <div class="line pull-in"></div>
                        <label class="col-lg-1 pull-left control-label">申请应收</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_applyReceivable" type="text" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/" disabled="disabled" class="form-control input-sm" ng-model="receivableData.applyReceivable" placeholder="请填写申请应收" name="applyReceivable">
                        </div>
                        <label class="pull-left m-l-n-sm control-label">元</label>
                        <label class="w-xxss pull-left m-l-sm control-label">结算方式</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_settlementTypeStr" type="text" class="form-control input-sm" ng-model="receivableData.settlementType" disabled="disabled" placeholder="请填写结算方式" name="settlementTypeStr">
                        </div>
                        <label class="w-xxss pull-left control-label">含税</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_includeTaxStr" type="text" class="form-control input-sm" ng-model="receivableData.includeTax" disabled="disabled" placeholder="请填写含税" name="includeTaxStr">
                        </div>
                        <div class="line pull-in"></div>
                        <label class="col-lg-1 pull-left control-label">应收说明</label>
                        <div class="col-lg-4">
                            <input id="receivableClose_reconciliation_receivableRemarks" type="text" class="form-control input-sm" ng-model="receivableRemarks" ng-disabled="priceDis" placeholder="请填写应收说明" name="receivableRemarks">
                        </div>
                        <label class="pull-left control-label">结算单位<span class="text-danger">*</span></label>
                        <div class="col-lg-4" ng-show="priceDis">
                            <input id="receivableClose_reconciliation_settle" type="text" class="form-control input-sm" ng-model="receivableData.settle" disabled="disabled" placeholder="请填写结算单位" name="settle">
                        </div>
                        <div class="col-lg-4" ng-show="!priceDis">
                            <!--<select id="receivableClose_reconciliation_settleId" class="form-control input-sm" ng-disabled="priceDis" ng-model="settleId" name="settleId" ng-options="x.id as x.name for x in selectList" required>
                                <option value="">请选择</option>
                            </select>-->
                            <div angucomplete-alt id="reckoner" placeholder="" pause="100" selected-object="onsettleSelected" remote-api-handler="onSettleAutoComplate" search-fields="name" title-field="name" minlength="0" input-class="form-control form-control-small input-sm" initial-value="reckoner"
                                match-class="highlight" field-required="true" input-name="reckoner">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="wrapper font-bold m-t-n">
                            工程信息
                        </div>
                        <label class="col-lg-1 pull-left control-label">工程名称</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_projectName" type="text" class="form-control input-sm" ng-model="childerData.projectName" disabled="disabled" placeholder="请填写工程名称" name="projectName">
                        </div>
                        <label class="pull-left control-label">工程编号</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_projectCode" type="text" class="form-control input-sm" ng-model="childerData.projectCode" disabled="disabled" placeholder="请填写工程编号" name="projectCode">
                        </div>
                        <label class="pull-left control-label">工程总量</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_projectTotal" type="text" class="form-control input-sm" ng-model="childerData.projectTotal" placeholder="请填写工程总量" disabled="disabled" name="projectTotal">
                        </div>
                        <div class="pull-left m-l-n-sm">
                            <input id="receivableClose_reconciliation_projectTotalUnit" name="projectTotalUnit" type="text" class="form-control" ng-value="childerData.projectTotalUnit" disabled="disabled">
                        </div>
                        <div class="line pull-in"></div>
                        <label class="col-lg-1 pull-left control-label">收货单位</label>
                        <div class="col-lg-3">
                            <input id="receivableClose_reconciliation_takeGoodsCompany" type="text" class="form-control input-sm" ng-model="childerData.takeGoodsCompany" placeholder="请填写收货单位" disabled="disabled" name="takeGoodsCompany">
                        </div>
                        <label class="pull-left control-label">收货人</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_consignee" type="text" class="form-control input-sm" ng-model="childerData.consignee" placeholder="请填写收货人" disabled="disabled" name="consignee">
                        </div>
                        <label class="pull-left control-label">收货人号码</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_consigneePhone" type="text" class="form-control input-sm" ng-model="childerData.consigneePhone" placeholder="请填写收货人号码" disabled="disabled" name="consigneePhone">
                        </div>
                        <div class="line pull-in"></div>
                        <label class="col-lg-1 pull-left control-label">发货单号</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_shipOrderId" type="text" class="form-control input-sm" ng-model="childerData.shipOrderId" placeholder="请填写发货单号" disabled="disabled" name="shipOrderId">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="panel-heading font-bold">
                            线路货物信息
                        </div>
                        <div class="wrapper-sm">
                            <div class="table-responsive table-cel-k">
                                <table class="table-bordered table-hover">
                                    <thead class="table-thea">
                                        <tr>
                                            <th width="9%">应收编号</th>
                                            <th width="9%">应收费用类型</th>
                                            <th width="9%">发货地址</th>
                                            <th width="9%">中转地</th>
                                            <th width="9%">送货地址</th>
                                            <th width="9%">货物名称</th>
                                            <th width="9%">货物数量</th>
                                            <th width="9%">申请应收</th>
                                            <th width="9%">结算单位</th>
                                            <th width="9%">结算状态</th>
                                        </tr>
                                    </thead>
                                    <tbody class="tab-tbod">
                                        <tr ng-repeat="item in receivableList" title="{{item.receivableCode}} {{item.feeType}} {{item.originAddress}} {{item.viaAddressList}} {{item.destinationAddress}} {{item.goodsName}} {{item.quantityOfGoods}} {{item.applyReceivable}} {{item.settle}} {{item.settleStatus}}">
                                            <td>{{item.receivableCode}}</td>
                                            <td>{{item.feeType}}</td>
                                            <td>{{item.originAddress}}</td>
                                            <td>{{item.viaAddressList}}</td>
                                            <td>{{item.destinationAddress}}</td>
                                            <td>{{item.goodsName}}</td>
                                            <td>{{item.quantityOfGoods}}</td>
                                            <td>{{item.applyReceivable}}</td>
                                            <td>{{item.settle}}</td>
                                            <td>{{item.settleStatus}}</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="form-group" ng-show="true">
                        <div class="panel-heading font-bold m-b-sm">
                            承运商车辆信息
                        </div>
                        <label class="col-lg-1 pull-left control-label">车牌号<span class="text-danger">*</span></label>
                        <label class="col-lg-2 control-label text-left">{{carrierOData.carCode}}</label>
                        <label class="pull-left control-label">驾驶员号码</label>
                        <label class="col-lg-2 control-label text-left">{{carrierOData.driverPhone}}</label>
                        <label class="pull-left control-label">驾驶员姓名</label>
                        <label class="col-lg-2 control-label text-left">{{carrierOData.driver}}</label>
                        <div class="line  pull-in"></div>
                        <label class="col-lg-1 pull-left control-label">车长</label>
                        <div class="col-lg-2 control-label text-left">
                            {{carrierOData.carLength}}
                        </div>
                        <label class="w-xxss pull-left control-label">车型</label>
                        <div class="col-lg-2 control-label text-left">
                            {{carrierOData.vehicleType}}
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="panel-heading font-bold m-b-sm">
                            回单信息
                        </div>
                        <label class="col-lg-1 pull-left control-label">回单状态</label>
                        <div class="col-lg-2">
                            <input id="receivableClose_reconciliation_receiptStatus" type="text" class="form-control input-sm" ng-value="orderData.receiptStatus" disabled="disabled" name="receiptStatus">
                        </div>
                        <div ng-if="contractNumberDis">
                            <label class="col-lg-1 pull-left control-label">合同号</label>
                            <div class="col-lg-2">
                                <input id="receivableClose_reconciliation_contractNumber" type="text" class="form-control input-sm" ng-model="carrierOData.contract.contractNumber" placeholder="" disabled="disabled" name="contractNumber">
                            </div>
                        </div>
                        <label class="col-lg-1 pull-left control-label">结算单据状态<span class="text-danger">*</span></label>
                        <div class="col-md-2">
                            <select class="form-control input-sm" ng-model="orderData.settlementStatusEnum" name="orderStatus" id="receivableManagent_settlementStatusEnum" ng-options="x.value as x.text for x in receiptBillStatusDropDown" disabled>
                                <option value="">全部</option>
                            </select>
            
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="panel-heading font-bold m-b-sm">
                            附件信息
                        </div>
                        <div ng-repeat="child in attachmentList">
                            <div class="panel-body">
                                <div class="col-md-4">
                                    <label class="pull-left m-l m-r">{{child.title}}</label>
                                    
                                </div>
                                <div class="wrapper-sm" id="uploading{{$index+1}}">
                                    <div class="line  pull-in"></div>
                                    <div class="wrapper-sm bg-light dk b-b m-b-xs hidden">
                                        <span class="">上传文件数: <b class="badge bg-info">{{ child.uploader.queue.length }}</b></span>
                                    </div>
                                    <table class="table bg-white-only b-a">
                                        <thead>
                                            <tr>
                                                <th width="50%">名称</th>
                                                <th >大小</th>
                                                <th >进度</th>
                                                <th>状态</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr ng-repeat="item in child.uploader.queue">
                                                <td>
                                                    <strong>{{ item.fileName }}</strong>
                                                    <div ng-if="item.imgSrc">
                                                        <img data-ng-src="{{item.imgSrc}}" style="width:300px" ng-click="handleImgClick(item)" data-toggle="modal" data-target="#imgRotate">
                                                    </div>
                                                </td>
                                                <td  nowrap>{{ item.fileSize/1024/1024|number:2 }} MB</td>
                                                <td >
                                                    <div class="progress" style="margin-bottom: 0;">
                                                        <div class="progress-bar" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
                                                    </div>
                                                </td>
                                                <td class="text-center">
                                                    <span ng-show="item.isSuccess"><i class="glyphicon glyphicon-ok"></i></span>
                                                    <span ng-show="item.isCancel"><i class="glyphicon glyphicon-ban-circle"></i></span>
                                                    <span ng-show="item.isError"><i class="glyphicon glyphicon-remove"></i></span>
                                                </td>
                                                <td nowrap>
                                                    <button id="receivableClose_reconciliation_attachmentOnDownload" class="btn btn-primary btn-xs" ng-click="child.uploader.onDownload(item)">
                                                        <span class="fa fa-cloud-download"></span> 下载
                                                    </button>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-7">
                            <button id="receivableClose_reconciliation_audited" class="pull-right-xs btn btn-sm btn-success btn-addon" ng-disabled="step1.$invalid" ng-click="audited()" ng-show="{{ auditedBtnHide }}"><i class="fa fa-check"></i>审核通过</button>
                            <button id="receivableClose_reconciliation_save" ng-if="returnManageBtnHide" class="pull-right-xs btn btn-sm btn-info btn-addon" ng-click="save()"><i class="fa fa-check"></i>保存</button>
                            <button id="receivableClose_reconciliation_returnManage" class="pull-right-xs btn btn-sm btn-primary btn-addon" ng-click="returnManage()" ng-show="{{ returnManageBtnHide }}"><i class="fa fa-mail-reply-all"></i>退回办理</button>
                            <button id="receivableClose_reconciliation_back" class="pull-right-xs btn btn-sm btn-warning btn-addon" ng-click="back()"><i class="fa fa-mail-reply"></i>返回</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <!-- imgrotate model -->
    <tms-img-rotate src="selectedImgSrc"></tms-img-rotate>
    
</div>